package com.zhongfl.crm.enums.boss;

import com.zhongfl.crm.exception.CRMException;
import lombok.Getter;

/**
 * @author 奈良鹿丸
 * @date 2018/9/12
 */
public enum ApprovalRoleEnum {

        DEFAULT_VAL(0, "默认值"),
        APPROVAL_TEAM_LEADER(100, "返费审批组长");

        @Getter
        private int value;

        @Getter
        private String desc;

        ApprovalRoleEnum(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public static ApprovalRoleEnum valueOf(int value) {
            for (ApprovalRoleEnum templateEnum : ApprovalRoleEnum.values()) {
                if (templateEnum.getValue() == value) {
                    return templateEnum;
                }
            }
            throw new CRMException("没有在ApprovalRoleEnum找到枚举值为" + value + "的枚举");
        }

}
